package com.henghong.risk.service.impl;

import com.henghong.risk.entity.A01M002Section;
import com.henghong.risk.entity.ProcessM;
import com.henghong.risk.entity.QualityProgression;
import com.henghong.risk.entity.RiskPrevention;
import com.henghong.risk.mapper.MenuMasterMapper;
import com.henghong.risk.result.Result;
import com.henghong.risk.service.MenuMasterService;
import com.henghong.risk.vo.MenuMasterVo;
import com.henghong.risk.vo.RpiOpenYearVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Service
public class MenuMasterServiceImpl implements MenuMasterService {

    @Autowired
    private MenuMasterMapper menuMasterMapper;

    @Override
    public MenuMasterVo ankenInfo() {

        MenuMasterVo menuMasterVo = new MenuMasterVo();

        // 获取支社ドロップダウンリスト信息
        List<A01M002Section> ddlPjBranchList = menuMasterMapper.getDdlPjBranchList();

        // 获取プロセスドロップダウンリスト信息
        List<ProcessM> ddlProcessList = menuMasterMapper.getDdlProcessList();

        // 获取開催年ドロップダウンリスト信息
        List<RpiOpenYearVo> ddlRpiOpenYearList = menuMasterMapper.getDdlRpiOpenYearList();

        // 获取開催年度ドロップダウンリスト信息
        List<QualityProgression> ddlQpOpenFiscalYearList = menuMasterMapper.getDdlQpOpenFiscalYearList();

        menuMasterVo.setDdlPjBranchList(ddlPjBranchList);
        menuMasterVo.setDdlProcessList(ddlProcessList);
        menuMasterVo.setDdlRpiOpenYearList(ddlRpiOpenYearList);
        menuMasterVo.setDdlQpOpenFiscalYearList(ddlQpOpenFiscalYearList);

        return menuMasterVo;
    }

    @Override
    public List<A01M002Section> selectedIndexChanged(String ddlPjBranch) {
        return menuMasterMapper.selectedIndexChanged(ddlPjBranch);
    }
}
